home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 698 b | 36 lines | [TEXT/CWIE] |
- // WindowLocator.cp
-
- #ifndef WindowLocator_h
- #include "WindowLocator.h"
- #endif
- #ifndef StrangeWindow_h
- #include "StrangeWindow.h"
- #endif
- #ifndef RedBlackLinkTree_h
- #include "RedBlackLinkTree.h"
- #endif
-
- WindowLocator::TreeType& WindowLocator::Tree()
- {
- static TreeType tree;
- return tree;
- }
-
- void WindowLocator::Register( Registration& registation )
- {
- Tree().Add( registation );
- }
-
- AbstractWindow& WindowLocator::LocateWindow( WindowPtr theWindow )
- {
- Registration *registration = Tree().Find( theWindow );
- if ( registration != 0 )
- return **registration;
-
- static StrangeWindow strange( 0 );
- strange = StrangeWindow( theWindow );
- return strange;
- }
-
- #include "RedBlackLinkTree.cp"
-